﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IceLiteBusinessLogic
{
    public class UnitOfWork : IUnitOfWork
    {
        private readonly IceLiteContext _liteContext;

        public UnitOfWork()
        {
            _liteContext = new IceLiteContext();
        }

        public IceLiteContext IceLiteDbContext
        {
            get { return _liteContext; }
        }

        public void Dispose()
        {
            if (_liteContext != null) _liteContext.Dispose();
            GC.SuppressFinalize(this);
        }

        public int SaveChanges()
        {
            return _liteContext.SaveChanges();
        }
    }
}
